﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Students
{

    class LINQFirstLastname
    {

        static void Main()
        {
            List<Student> students = new List<Student>();
            students.Add(new Student("Pesho", "Stoianoff"));
            students.Add(new Student("Pesho", "Gurov"));
            students.Add(new Student("Peshov", "Pesho"));

            var querySmallNums =
                from student in students
                where student.Fname.CompareTo(student.Lname) <= 0
                select student;

            foreach (var num in querySmallNums)
            {
                Console.Write(num.Fname + " " + num.Lname);
                Console.WriteLine();
            }
        }
    }
}
